import re

s = "python itheima python python"

# match 从头匹配，匹配第一个命中项
result = re.match("python", s)
print(result)
print(result.span())
print(result.group())

# search 全局匹配，匹配第一个命中项
result = re.search("python", s)
print(result)

# findall 全局匹配，匹配所有命中项
list = re.findall("python", s)
print(list)
for word in list:
    print(word)
    print(type(word))





